const state = {
  current: 0,
}

const mutations = {
  /**
   * 修改state的值
   * @param { object } state
   * @param { object } options 需要修改的值
   */
  setState(state, options) {
    if (typeof options !== 'object') return
    if (options.key && options.data) {
      state[options.key] = options.data
    } else {
      for (const key in options) {
        state[key] = options[key]
      }
    }
  },
}

const actions = {}

export default {
  namespaced: true,
  state,
  actions,
  mutations,
}
